<style>
    #gototop{width:80px;height:60px;background:url('<?php echo Yii::app()->baseUrl; ?>/images/top.png') 0px 0px no-repeat;position:fixed;right:5px;bottom:250px;cursor:pointer;}
    #gototop:hover{background:url('<?php echo Yii::app()->baseUrl; ?>/images/top.png') 0px -61px no-repeat;}
</style>
<div id="gototop" title="回到顶部" onclick="$('html, body').animate({scrollTop: '0px'},600);"></div>
<script>
    $("#gototop").click(function(){
        $("html, body").animate({scrollTop: "0px"},600);
    })
</script>